package com.rtuwrapper.messaging;

import com.rtuwrapper.processing.Precision;
import com.rtuwrapper.processing.Register;

import static com.rtuwrapper.ModbusConstants.READ_REGISTER;

/**
 * Created by westl on 2018/9/10 0010.
 */

public class ReadFloatResponse  extends BaseResponse<Precision, Float> {

    public ReadFloatResponse(byte[] message) {
        super(READ_REGISTER, message);
    }

    @Override
    public Precision decodeMessage(byte[] message) {
        float value = getMessageProcessor().getReadResponseFloat(message);
        return new Precision(-1, value);
    }
}